//
// Created by Administrator on 2021/11/23.
// May Saint Diana bless you!
//
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

class Solution {
public:
    int countGoodSubstrings(string s) {
        int m = s.size();
        if (m < 3)
            return 0;
        int counter = 0;
        for (int i = 0; i < m - 2; ++i) {
            char a = s[i], b = s[i + 1], c = s[i + 2];
            if (a != b && a != c && b != c)
                ++counter;
        }
        return counter;
    }
};

int main() {
    Solution solution;
    cout << solution.countGoodSubstrings("xyzzaz") << endl;
    cout << solution.countGoodSubstrings("aababcabc") << endl;
    return 0;
}
